<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::group([], function () {
  Route::post('/user/logout', 'AccountController@logout');
  Route::post('/user/login', 'AccountController@login');
  Route::get('/user/info', 'AccountController@getUserInfo');
  Route::post('/user/update_settings', 'AccountController@updateSettings');
  Route::post('/user/update_password', 'AccountController@updatePassword');
  Route::resource('user', 'AccountController');

  Route::post('/fans/batch_upload', 'FansController@batchUpload');
  Route::post('/fans/{id}/set_sex', 'FansController@setSex');
  Route::post('/fans/{id}/set_exists', 'FansController@setExists');
  Route::post('/fans/{id}/set_certification', 'FansController@setCertification');
  Route::post('/fans/{id}/set_used', 'FansController@setUsed');
  Route::post('/fans/{id}/set_qq_exception', 'FansController@setQQException');
  Route::post('/fans/{id}/reset_qq', 'FansController@resetQQ');
  Route::post('/fans/{id}/qq_password_error', 'FansController@qqErrorPassword');
  Route::post('/fans/batch_remove', 'FansController@batchRemove');
  Route::get('/fans/remove_all', 'FansController@removeAll');
  Route::get('/fans/get_one', 'FansController@getOne');
  Route::get('/fans/get_phone', 'FansController@getPhone');
  Route::post('/fans/reset_phone', 'FansController@resetPhone');
  Route::get('/fans/get_qq', 'FansController@getQq');
  Route::get('/fans/getLogPhone', 'FansController@getLogPhone');
  Route::post('/fans/set_log_phone', 'FansController@setLogPhone');
  Route::get('fans/qq', 'FansController@qq');
  Route::get('fans/log_phone', 'FansController@logPhone');
  Route::post('fans/qq_comment', 'FansController@qqComment');
  Route::post('fans/qq/set_group', 'FansController@setQQGroup');
  Route::post('/fans/cover_qq', 'FansController@coverQQ');
  Route::delete('fans', 'FansController@deleteAll');
  Route::delete('fans/qq', 'FansController@deleteAllQQ');
  Route::delete('fans/log_phone', 'FansController@deleteAllLogPhone');
  Route::resource('fans', 'FansController');


  Route::post('/panda-fans/batch_upload', 'PandaFansController@batchUpload');
  Route::post('/panda-fans/{id}/set_sex', 'PandaFansController@setSex');
  Route::post('/panda-fans/{id}/set_exists', 'PandaFansController@setExists');
  Route::post('/panda-fans/{id}/set_certification', 'PandaFansController@setCertification');
  Route::post('/panda-fans/{id}/set_used', 'PandaFansController@setUsed');
  Route::post('/panda-fans/batch_remove', 'PandaFansController@batchRemove');
  Route::get('/panda-fans/remove_all', 'PandaFansController@removeAll');
  Route::get('/panda-fans/get_one', 'PandaFansController@getOne');
  Route::delete('panda-fans', 'PandaFansController@deleteAll');
  Route::post('/activation', 'PandaFansController@store');
  Route::resource('panda-fans', 'PandaFansController');

  Route::post('/devices/{id}/set_wechat_friend', 'DeviceController@setWechatFriend');
  Route::post('/devices/{id}/set_alipay_friend', 'DeviceController@setAlipayFriend');
  Route::get('/devices/is_maxed', 'DeviceController@isMaxed');
  Route::get('/devices/{id}/yesterday_foster', 'DeviceController@yesterdayFoster');
  Route::post('/devices/update_max', 'DeviceController@updateMax');
  Route::post('/devices/create_online', 'DeviceController@createOnline');
  Route::post('/devices/{id}/group', 'DeviceController@setDeviceGroup');
  Route::resource('devices', 'DeviceController');

  Route::get('/settings/default', 'AccountController@settings');
  Route::post('/posts', 'PostController@store');

  Route::get('/sentence/get_one', 'SentenceController@getOne');
  Route::resource('sentence', 'SentenceController');

  Route::post('/data-resources/batch_remove', 'DataResourceController@batchRemove');
  Route::get('/data-resources/get_one', 'DataResourceController@getOne');
  Route::get('/data-resources/get_copy', 'DataResourceController@getCopy');//附加
  Route::get('/data-resources/getAlipay', 'DataResourceController@getAlipay');
  Route::post('/data-resources/set_registered', 'DataResourceController@setRegistered');
  Route::post('/data-resources/set_alipay_name', 'DataResourceController@setAlipayName');
  Route::get('/data-resources/cache_alipay', 'DataResourceController@cacheAlipay');//附加
  Route::post('/data-resources/set_copy', 'DataResourceController@setCopy');//附加
  Route::post('/data-resources/batch_upload', 'DataResourceController@batchUpload');
  Route::post('/data-resources/batch_upload_copy', 'DataResourceController@batchUploadCopy');//附加
  Route::delete('data-resources', 'DataResourceController@deleteAll');
  Route::delete('data-resources-copy', 'DataResourceController@deleteAllCopy');//附加
  Route::resource('data-resources', 'DataResourceController');
  Route::get('data-resources-copy', 'DataResourceController@copyIndex');//附加
  Route::get('alipay-data-resources', 'DataResourceController@alipayIndex');

//  Route::get('/device-groups/{id}/sns', 'DeviceGroupsController@getSns'); // 更换URL
  Route::get('/sns/one', 'DeviceGroupsController@getSns');

  Route::resource('device-groups', 'DeviceGroupsController', ['only' => ['index', 'show', 'store', 'update', 'destroy']]);
  Route::post('/upload/img', 'UploadController@imgUpload');
  Route::post('/upload/video', 'UploadController@videoUpload');
  Route::post('/upload/delete-pic', 'UploadController@imgDelete');
  Route::post('/upload/delete-video', 'UploadController@videoDelete');
  Route::post('/upload/delete-tmp-pic', 'UploadController@tmpImgDelete');
//  Route::post('/sns/{id}/devices', 'SnsController@postedDevice');
  Route::resource('sns', 'SnsController', ['only' => ['index', 'store', 'update', 'destroy']]);
//  Route::get('/qiniu/upload/token', 'QiniuController@getToken');
  Route::resource('tasks', 'TaskController', ['only' => ['index', 'store', 'update', 'destroy']]);

//  Route::get('/device-group/{id}/device-group-tasks/getone', 'DeviceGroupTaskController@getOne'); // 更换URL
  Route::delete('/device-group-tasks/{id}/reset', 'DeviceGroupTaskController@reset');
  Route::get('/device-group-tasks/getone', 'DeviceGroupTaskController@getOne');
  Route::post('/device-group-tasks/{id}/devices', 'DeviceGroupTaskController@finishedDevice');
  Route::delete('device-group-tasks', 'DeviceGroupTaskController@deleteAll');
  Route::resource('device-group-tasks', 'DeviceGroupTaskController', ['only' => ['index', 'store', 'update', 'destroy']]);
  Route::get('device-remove-duplicate', 'ToolController@deviceRemoveDuplicate');

  Route::get('/device-group-sentences/get_one', 'DeviceGroupSentenceController@getOne');
  Route::get('/device-group-sentences/group_wechat', 'DeviceGroupSentenceController@GroupWechat');
  Route::post('/device-group-sentences/group_wechat', 'DeviceGroupSentenceController@GroupWechat');
  Route::post('/device-group-sentences/set-group', 'DeviceGroupSentenceController@setDeviceGroup');
  Route::delete('/device-group-sentences', 'DeviceGroupSentenceController@deleteAll');
  Route::resource('device-group-sentences', 'DeviceGroupSentenceController');

  Route::post('/finish_confluence','Controller@finishConfluence');
  Route::post('/finish_confluence_task','Controller@finishConfluenceTask');
  Route::get('/detailIndex','Controller@detailIndex');
  Route::get('/run','Controller@run');//某次更新需要用到
  Route::get('/test','CrontabController@test');//某次更新需要用到

    Route::post('/groupWechat','DeviceGroupsController@groupWechat');
    Route::get('/getGroupWechat','DeviceGroupsController@getGroupWechat');

    Route::post('/insertWechat','FansController@insertWechat');

    Route::post('/pinCheck','Controller@pinCheck');

    Route::get('wechatList', 'FansController@wechatList');
    Route::post('wechatList/deleteAll', 'FansController@wechatListDelete');

    Route::get('/cardSentence/get_one', 'CardSentenceController@getOne');
    Route::delete('/cardSentence/deleteAll', 'CardSentenceController@DeleteAll');
    Route::resource('cardSentence', 'CardSentenceController');
    Route::post('/cardSentence/batch_upload', 'CardSentenceController@batchUpload');
    Route::post('/cardSentence/batch_remove', 'CardSentenceController@batchRemove');
});
